package com.metier;

import java.io.Serializable;


/**
 * This is an object that contains data related to the contexte table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="contexte"
 */

public abstract class BaseContexte  implements Serializable {

	public static String REF = "Contexte";
	public static String PROP_FK_ETU = "FkEtu";
	public static String PROP_FK_EXP = "FkExp";
	public static String PROP_ID_TYPE = "IdType";
	public static String PROP_ID = "Id";


	// constructors
	public BaseContexte () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseContexte (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseContexte (
		com.metier.TypeContexte idType) {

		this.setIdType(idType);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// many to one
	private com.metier.TypeContexte idType;
	private com.metier.Etude fkEtu;
	private com.metier.Experience fkExp;

	// collections
	private java.util.Set<com.metier.Utilisateur> contacts;
	private java.util.Set<com.metier.Utilisateur> contactTemps;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="sequence"
     *  column="id_contexte"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: id_type
	 */
	public com.metier.TypeContexte getIdType () {
		return idType;
	}

	/**
	 * Set the value related to the column: id_type
	 * @param idType the id_type value
	 */
	public void setIdType (com.metier.TypeContexte idType) {
		this.idType = idType;
	}



	/**
	 * Return the value associated with the column: fk_etu
	 */
	public com.metier.Etude getFkEtu () {
		return fkEtu;
	}

	/**
	 * Set the value related to the column: fk_etu
	 * @param fkEtu the fk_etu value
	 */
	public void setFkEtu (com.metier.Etude fkEtu) {
		this.fkEtu = fkEtu;
	}



	/**
	 * Return the value associated with the column: fk_exp
	 */
	public com.metier.Experience getFkExp () {
		return fkExp;
	}

	/**
	 * Set the value related to the column: fk_exp
	 * @param fkExp the fk_exp value
	 */
	public void setFkExp (com.metier.Experience fkExp) {
		this.fkExp = fkExp;
	}



	/**
	 * Return the value associated with the column: Contacts
	 */
	public java.util.Set<com.metier.Utilisateur> getContacts () {
		return contacts;
	}

	/**
	 * Set the value related to the column: Contacts
	 * @param contacts the Contacts value
	 */
	public void setContacts (java.util.Set<com.metier.Utilisateur> contacts) {
		this.contacts = contacts;
	}



	/**
	 * Return the value associated with the column: ContactTemps
	 */
	public java.util.Set<com.metier.Utilisateur> getContactTemps () {
		return contactTemps;
	}

	/**
	 * Set the value related to the column: ContactTemps
	 * @param contactTemps the ContactTemps value
	 */
	public void setContactTemps (java.util.Set<com.metier.Utilisateur> contactTemps) {
		this.contactTemps = contactTemps;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.metier.Contexte)) return false;
		else {
			com.metier.Contexte contexte = (com.metier.Contexte) obj;
			if (null == this.getId() || null == contexte.getId()) return false;
			else return (this.getId().equals(contexte.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}